<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/19
 * Time: 23:47
 */

namespace app\common\validate;


use think\Validate;

class Category extends Validate
{
    protected $rule=[
        'id'=> 'number',
        'name'=> 'require|max:10',
        'parent_id'=> 'number',
        'listorder'=> 'number',
        'status'=> 'number|in:-1,0,1',
    ];
    protected $scene=[
        'add'=>['name','parent_id'],
        'edit'=>['id','name','parent_id'],
        'listorder'=>['id','listorder'],
        'status'=>['id','status'],
    ];
}